package testClasses;

import java.io.File;

import javax.swing.JOptionPane;

import model.DocumentEA;
import model.MainModel;
import connectors.EAConnector;
import connectors.ExcelConnector;

public class testClass {
	final static String sep = File.separator;

	public void importTDsFromCSVToEA() {
		String importFilePath = "DATA" + sep + "TD_PSL_INT_TD_InventoryCSV.csv";

		String outputFilePath = "DATA" + sep + "output.xls";

		String modelFilePath = System.getProperty("user.dir") + sep + "DATA"
				+ sep + "PSLIntAAS.eap";
		MainModel model = new MainModel();
		ExcelConnector con = new ExcelConnector(model, importFilePath,
				outputFilePath);
		EAConnector eacon = new EAConnector(modelFilePath);
	    eacon.importDocumentStructure(model.getEADocumentModel());

		for (DocumentEA dea : model.getEADocumentModel()) {
			System.out.println("*********************************");
			System.out.println("Document: ");
			System.out.println("Name: " + dea.getName());
			System.out.println("Type: " + dea.getType());
			System.out.println("Version: " + dea.getVersion());
			System.out.println("GetNewOrChange: " + dea.getNewOrChange());
			System.out.println("Mapped values: " + dea.getMappingObjectNames());
		}
		JOptionPane.showMessageDialog(null, "Importing Finished", "Success",
				JOptionPane.PLAIN_MESSAGE);

	}

	public static void main(String[] args) {
		new testClass().importTDsFromCSVToEA();
	}
}
